<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function* show() {
      console.log(111111);
      yield 1;
      console.log(222222);
      yield 2;
      console.log(333333);
      yield 3;
    }
    var rel = show()
    var flag = rel.next()
    while (!flag.done) {
      console.log(flag.value, flag.done);
      flag = rel.next()
    }
  </script>
</body>

</html>